package com.example.androidproject.ui.presenter;

import com.example.androidproject.ui.base.IBasePresenter;
import com.example.androidproject.view.TestView;
import com.hyg.idea.net.common.APICallback;

/**
 * FileName: TestPresenter
 * Author: huangyuguang
 * Date: 2022/5/11
 * Description:
 */
public class TestPresenter extends IBasePresenter<TestView> {

    public TestPresenter(TestView view) {
        super(view);
    }

    public void getTestData(){
        mApiService.getTest()
                .compose(mView.rxSchedulerHelper(true))
                .subscribe(new APICallback<String>() {
                    @Override
                    public void onSuccess(String response) {
                        mView.onGetTestDataSuccess(response);
                    }

                    @Override
                    public void onFail(String message) {
                        super.onFail(message);
                        mView.onError(message);
                    }
                });
    }
}
